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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

g.x = d
k.t = f
k.u = d
k.v = l
f.v = g
i.z = m
i.s = f
i.v = f
i.u = l
i.r = k
d.y = g
b.z = k
m.z = i
m.s = f
m.v = f
m.u = l
m.r = k
l.z = k
e.z = i
e.s = f
e.v = f
e.u = l
e.r = k
assert m.z.u.z.v.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

g.x = d
k.t = f
k.u = d
k.v = l
f.v = g
i.z = m
i.s = f
i.v = f
i.u = l
i.r = k
d.y = g
b.z = k
m.z = i
m.s = f
m.v = f
m.u = l
m.r = k
l.z = k
e.z = i
e.s = f
e.v = f
e.u = l
e.r = k
assert m.z.u.z.v.z.u.txt == "d"