class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: F = None
        self.z: E = None
        self.x: C = None
        self.s: A = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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