class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: F = None
        self.y: D = None
        self.u: F = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: E = None
        self.txt = txt

d = A("d")
a = B("a")
e = C("e")
c = D("c")
m = E("m")
n = F("n")
l = B("l")
h = F("h")
i = C("i")
j = E("j")

d.x = i
d.r = n
d.y = c
d.u = h
d.o = l
a.v = e
e.o = i
e.v = j
e.w = m
c.v = d
m.w = d
n.w = m
n.p = j
l.v = i
h.w = m
h.p = m
i.o = e
i.v = j
i.w = m
j.w = d
assert c.v.u.w.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: F = None
        self.y: D = None
        self.u: F = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: E = None
        self.txt = txt

d = A("d")
a = B("a")
e = C("e")
c = D("c")
m = E("m")
n = F("n")
l = B("l")
h = F("h")
i = C("i")
j = E("j")

d.x = i
d.r = n
d.y = c
d.u = h
d.o = l
a.v = e
e.o = i
e.v = j
e.w = m
c.v = d
m.w = d
n.w = m
n.p = j
l.v = i
h.w = m
h.p = m
i.o = e
i.v = j
i.w = m
j.w = d
assert c.v.u.w.w.u.txt == "h"