class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: H = None
        self.u: C = None
        self.q: C = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: H = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: C = None
        self.o: G = None
        self.y: F = None
        self.u: F = None
        self.p: G = None
        self.w: C = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: D = None
        self.x: B = None
        self.z: D = None
        self.p: D = None
        self.r: C = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: H = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: C = None
        self.o: G = None
        self.y: F = None
        self.u: F = None
        self.p: G = None
        self.w: C = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: D = None
        self.x: B = None
        self.z: D = None
        self.p: D = None
        self.r: C = None
        self.o: B = None
        self.txt = txt

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

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