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

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

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

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

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

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

j = A("j")
d = B("d")
f = C("f")
g = D("g")
c = E("c")
a = F("a")

j.t = c
j.u = c
j.p = c
j.r = a
j.q = a
d.y = c
d.o = f
f.z = c
g.v = d
g.p = f
c.u = g
c.s = g
c.r = d
c.t = a
c.z = a
a.t = f
a.z = d
a.w = j
a.v = c
assert a.w.q.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: E = None
        self.r: F = None
        self.q: F = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

j = A("j")
d = B("d")
f = C("f")
g = D("g")
c = E("c")
a = F("a")

j.t = c
j.u = c
j.p = c
j.r = a
j.q = a
d.y = c
d.o = f
f.z = c
g.v = d
g.p = f
c.u = g
c.s = g
c.r = d
c.t = a
c.z = a
a.t = f
a.z = d
a.w = j
a.v = c
assert a.w.q.z.o.txt == "f"