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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: B = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: C = None
        self.txt = txt

d = A("d")
e = B("e")
a = C("a")
m = D("m")
c = E("c")
j = F("j")
i = C("i")
l = D("l")
k = B("k")

d.v = m
e.x = l
e.u = c
a.x = d
a.v = i
m.z = d
m.v = k
m.r = a
c.y = k
c.t = e
c.x = l
j.q = a
j.o = i
i.x = d
i.v = a
l.z = d
l.v = e
l.r = a
k.x = m
k.u = c
assert k.u.t.u.x.z.v.v.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: B = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: C = None
        self.txt = txt

d = A("d")
e = B("e")
a = C("a")
m = D("m")
c = E("c")
j = F("j")
i = C("i")
l = D("l")
k = B("k")

d.v = m
e.x = l
e.u = c
a.x = d
a.v = i
m.z = d
m.v = k
m.r = a
c.y = k
c.t = e
c.x = l
j.q = a
j.o = i
i.x = d
i.v = a
l.z = d
l.v = e
l.r = a
k.x = m
k.u = c
assert k.u.t.u.x.z.v.v.u.t.txt == "e"