class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: C = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.v: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: A = None
        self.txt = txt

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

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

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

f = A("f")
b = B("b")
h = C("h")
k = D("k")
l = E("l")
d = F("d")
g = E("g")
e = B("e")
n = F("n")

f.z = k
f.u = h
f.y = h
b.y = n
b.o = l
b.v = e
h.u = f
h.q = f
k.p = l
l.s = e
l.o = h
l.v = h
d.t = l
d.p = n
g.s = b
g.o = h
g.v = h
e.y = n
e.o = l
e.v = b
n.t = l
n.p = d
assert h.q.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: C = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.v: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: A = None
        self.txt = txt

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

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

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

f = A("f")
b = B("b")
h = C("h")
k = D("k")
l = E("l")
d = F("d")
g = E("g")
e = B("e")
n = F("n")

f.z = k
f.u = h
f.y = h
b.y = n
b.o = l
b.v = e
h.u = f
h.q = f
k.p = l
l.s = e
l.o = h
l.v = h
d.t = l
d.p = n
g.s = b
g.o = h
g.v = h
e.y = n
e.o = l
e.v = b
n.t = l
n.p = d
assert h.q.z.p.txt == "l"