class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: E = None
        self.z: F = None
        self.u: E = None
        self.w: D = None
        self.r: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.x: E = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
m = C("m")
l = D("l")
i = E("i")
b = F("b")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.x: E = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
m = C("m")
l = D("l")
i = E("i")
b = F("b")

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