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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: E = None
        self.y: C = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: C = None
        self.v: B = None
        self.z: B = None
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: C = None
        self.p: E = None
        self.z: A = None
        self.q: D = None
        self.txt = txt

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

l.y = j
d.q = j
d.t = j
d.o = j
d.y = h
d.z = c
h.y = f
h.q = b
b.y = j
b.t = h
b.v = e
b.z = e
b.w = c
j.t = d
a.v = d
a.s = h
a.p = j
a.z = c
a.q = b
m.v = e
m.s = h
m.p = j
m.z = l
m.q = b
c.y = j
f.v = e
f.s = h
f.p = j
f.z = l
f.q = b
e.q = j
e.t = j
e.o = j
e.y = h
e.z = l
assert b.y.t.t.t.z.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: E = None
        self.y: C = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: C = None
        self.v: B = None
        self.z: B = None
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: C = None
        self.p: E = None
        self.z: A = None
        self.q: D = None
        self.txt = txt

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

l.y = j
d.q = j
d.t = j
d.o = j
d.y = h
d.z = c
h.y = f
h.q = b
b.y = j
b.t = h
b.v = e
b.z = e
b.w = c
j.t = d
a.v = d
a.s = h
a.p = j
a.z = c
a.q = b
m.v = e
m.s = h
m.p = j
m.z = l
m.q = b
c.y = j
f.v = e
f.s = h
f.p = j
f.z = l
f.q = b
e.q = j
e.t = j
e.o = j
e.y = h
e.z = l
assert b.y.t.t.t.z.y.t.txt == "d"