class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: B = None
        self.v: D = None
        self.x: E = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.o: D = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: A = None
        self.o: G = None
        self.w: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: D = None
        self.z: B = None
        self.u: D = None
        self.q: D = None
        self.w: F = None
        self.txt = txt

e = A("e")
n = B("n")
b = C("b")
m = D("m")
i = E("i")
l = F("l")
k = G("k")
j = E("j")
f = B("f")
c = G("c")

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.o: D = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: A = None
        self.o: G = None
        self.w: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: D = None
        self.z: B = None
        self.u: D = None
        self.q: D = None
        self.w: F = None
        self.txt = txt

e = A("e")
n = B("n")
b = C("b")
m = D("m")
i = E("i")
l = F("l")
k = G("k")
j = E("j")
f = B("f")
c = G("c")

e.p = m
e.v = m
e.s = f
e.x = j
e.r = b
n.q = m
n.u = m
b.z = n
b.x = e
b.o = m
b.u = f
m.v = n
m.w = n
m.p = e
m.o = k
i.w = m
l.u = e
k.s = i
k.x = m
k.u = m
k.q = m
k.z = f
k.w = l
j.w = m
f.q = m
f.u = m
c.s = i
c.x = m
c.u = m
c.q = m
c.z = f
c.w = l
assert c.z.u.w.u.w.q.txt == "m"