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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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