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

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

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

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

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

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

m = A("m")
h = B("h")
f = C("f")
g = D("g")
a = E("a")
d = F("d")
k = B("k")
c = B("c")
j = F("j")
l = D("l")

m.o = f
m.u = f
m.v = d
h.p = a
h.u = a
h.q = k
h.w = k
h.x = k
h.v = l
f.x = l
f.t = k
f.q = d
g.o = m
g.q = a
a.x = d
a.q = f
d.o = m
d.x = a
d.z = f
k.p = a
k.u = a
k.q = h
k.w = h
k.x = c
k.v = l
c.p = a
c.u = a
c.q = h
c.x = h
c.w = k
c.v = g
j.o = m
j.x = a
j.z = f
l.o = m
l.q = a
assert c.w.v.o.v.z.x.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: F = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

m = A("m")
h = B("h")
f = C("f")
g = D("g")
a = E("a")
d = F("d")
k = B("k")
c = B("c")
j = F("j")
l = D("l")

m.o = f
m.u = f
m.v = d
h.p = a
h.u = a
h.q = k
h.w = k
h.x = k
h.v = l
f.x = l
f.t = k
f.q = d
g.o = m
g.q = a
a.x = d
a.q = f
d.o = m
d.x = a
d.z = f
k.p = a
k.u = a
k.q = h
k.w = h
k.x = c
k.v = l
c.p = a
c.u = a
c.q = h
c.x = h
c.w = k
c.v = g
j.o = m
j.x = a
j.z = f
l.o = m
l.q = a
assert c.w.v.o.v.z.x.o.v.txt == "d"