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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: C = None
        self.x: D = None
        self.r: F = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: A = None
        self.txt = txt

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

f = A("f")
l = B("l")
b = C("b")
m = D("m")
e = E("e")
g = F("g")
j = E("j")
a = D("a")
n = D("n")

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: C = None
        self.x: D = None
        self.r: F = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: A = None
        self.txt = txt

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

f = A("f")
l = B("l")
b = C("b")
m = D("m")
e = E("e")
g = F("g")
j = E("j")
a = D("a")
n = D("n")

f.x = g
f.r = a
f.z = j
f.w = l
f.q = l
f.t = m
l.y = j
b.x = g
b.p = m
m.u = b
m.s = b
m.w = b
m.x = a
m.r = g
e.x = b
e.r = f
g.s = l
g.w = l
g.p = b
g.y = e
g.v = f
g.u = f
j.x = b
j.r = f
a.u = b
a.s = b
a.w = b
a.x = m
a.r = g
n.u = b
n.s = b
n.w = b
n.x = a
n.r = g
assert j.r.t.r.u.txt == "f"