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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: E = None
        self.x: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: F = None
        self.q: E = None
        self.x: F = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: C = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: C = None
        self.u: C = None
        self.s: E = None
        self.txt = txt

i = A("i")
c = B("c")
j = C("j")
d = D("d")
h = E("h")
b = F("b")
l = C("l")
k = A("k")

i.t = d
c.s = j
c.o = h
j.y = b
j.z = h
j.x = l
d.p = l
d.z = b
d.x = b
d.t = b
d.q = h
h.q = j
h.y = j
h.o = d
b.x = k
b.p = j
b.u = j
b.s = h
l.y = b
l.z = h
l.x = j
k.t = d
assert i.t.q.y.y.x.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: E = None
        self.x: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: F = None
        self.q: E = None
        self.x: F = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: C = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: C = None
        self.u: C = None
        self.s: E = None
        self.txt = txt

i = A("i")
c = B("c")
j = C("j")
d = D("d")
h = E("h")
b = F("b")
l = C("l")
k = A("k")

i.t = d
c.s = j
c.o = h
j.y = b
j.z = h
j.x = l
d.p = l
d.z = b
d.x = b
d.t = b
d.q = h
h.q = j
h.y = j
h.o = d
b.x = k
b.p = j
b.u = j
b.s = h
l.y = b
l.z = h
l.x = j
k.t = d
assert i.t.q.y.y.x.t.p.txt == "l"