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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: A = None
        self.v: A = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: A = None
        self.v: A = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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