class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: D = None
        self.y: D = None
        self.u: D = None
        self.r: C = None
        self.p: A = None
        self.txt = txt

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

j = A("j")
f = B("f")
c = C("c")
i = D("i")
b = E("b")
n = F("n")

j.q = f
j.r = f
j.w = n
f.y = n
f.u = j
f.z = j
f.s = b
c.u = f
c.v = f
c.x = f
c.p = j
c.t = i
i.o = f
i.t = f
b.s = i
b.q = i
b.y = i
b.u = i
b.r = c
b.p = j
n.u = b
n.s = f
n.r = j
n.t = c
n.y = c
assert n.r.r.y.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: D = None
        self.y: D = None
        self.u: D = None
        self.r: C = None
        self.p: A = None
        self.txt = txt

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

j = A("j")
f = B("f")
c = C("c")
i = D("i")
b = E("b")
n = F("n")

j.q = f
j.r = f
j.w = n
f.y = n
f.u = j
f.z = j
f.s = b
c.u = f
c.v = f
c.x = f
c.p = j
c.t = i
i.o = f
i.t = f
b.s = i
b.q = i
b.y = i
b.u = i
b.r = c
b.p = j
n.u = b
n.s = f
n.r = j
n.t = c
n.y = c
assert n.r.r.y.y.t.txt == "i"