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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: A = None
        self.y: A = None
        self.p: F = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: A = None
        self.y: A = None
        self.p: F = None
        self.r: B = None
        self.txt = txt

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

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

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

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