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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: A = None
        self.r: B = None
        self.t: D = None
        self.w: F = None
        self.s: E = None
        self.txt = txt

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

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

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

j = A("j")
i = B("i")
a = C("a")
k = D("k")
e = E("e")
h = F("h")
c = D("c")
f = B("f")

j.t = h
i.y = a
i.p = k
a.q = k
a.u = j
a.r = i
a.t = c
a.w = h
a.s = e
k.u = f
k.t = j
k.y = h
k.r = h
e.w = i
e.p = a
h.s = j
h.z = j
h.p = j
h.q = e
h.w = e
h.y = f
c.u = f
c.t = j
c.y = h
c.r = h
f.y = a
f.p = c
assert h.y.y.q.u.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: A = None
        self.r: B = None
        self.t: D = None
        self.w: F = None
        self.s: E = None
        self.txt = txt

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

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

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

j = A("j")
i = B("i")
a = C("a")
k = D("k")
e = E("e")
h = F("h")
c = D("c")
f = B("f")

j.t = h
i.y = a
i.p = k
a.q = k
a.u = j
a.r = i
a.t = c
a.w = h
a.s = e
k.u = f
k.t = j
k.y = h
k.r = h
e.w = i
e.p = a
h.s = j
h.z = j
h.p = j
h.q = e
h.w = e
h.y = f
c.u = f
c.t = j
c.y = h
c.r = h
f.y = a
f.p = c
assert h.y.y.q.u.y.r.txt == "i"