class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: E = None
        self.u: D = None
        self.p: C = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: D = None
        self.r: B = None
        self.s: C = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: D = None
        self.r: B = None
        self.s: C = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.w: B = None
        self.txt = txt

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

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

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

d.s = l
d.r = l
d.u = g
d.p = e
d.o = f
f.v = d
e.y = d
e.u = g
e.r = f
e.s = m
e.t = m
g.v = f
g.w = f
g.o = d
l.r = n
l.y = n
n.z = f
m.y = d
m.u = g
m.r = f
m.s = e
m.t = e
a.r = n
a.y = n
assert a.y.z.v.txt == "d"