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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: F = None
        self.x: A = None
        self.u: E = None
        self.r: E = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.t: D = None
        self.y: F = None
        self.s: A = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: F = None
        self.x: A = None
        self.u: E = None
        self.r: E = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.t: D = None
        self.y: F = None
        self.s: A = None
        self.o: A = None
        self.txt = txt

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

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

h.u = c
h.o = e
h.v = m
i.q = k
i.x = h
i.p = d
m.v = c
m.x = n
c.z = m
c.q = a
c.x = k
c.u = d
c.r = d
c.p = j
d.v = k
d.q = e
d.t = c
d.y = a
d.s = j
d.o = j
a.z = n
a.w = c
a.u = c
a.t = i
k.u = c
k.o = d
k.v = m
j.u = c
j.o = e
j.v = m
n.q = h
n.x = j
n.p = e
e.v = j
e.q = d
e.t = c
e.y = a
e.s = k
e.o = h
assert m.v.p.u.z.x.p.y.u.txt == "c"