class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: D = None
        self.r: D = None
        self.y: C = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: G = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: C = None
        self.y: F = None
        self.r: D = None
        self.o: F = None
        self.t: C = None
        self.p: H = None
        self.s: D = None
        self.txt = txt

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

i = A("i")
g = B("g")
e = C("e")
a = D("a")
j = E("j")
d = F("d")
l = G("l")
b = H("b")
m = G("m")
n = C("n")

i.z = b
i.r = b
g.r = e
e.y = g
e.t = b
a.z = j
j.z = a
j.v = a
j.r = a
j.y = e
j.q = l
d.p = i
d.x = m
d.s = b
l.q = d
l.y = d
l.o = d
l.w = n
l.r = a
l.s = a
l.t = e
l.p = b
b.w = g
b.p = g
m.q = d
m.y = d
m.o = d
m.w = e
m.t = e
m.r = a
m.s = a
m.p = b
n.y = g
n.t = b
assert m.p.w.r.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: D = None
        self.r: D = None
        self.y: C = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: G = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: C = None
        self.y: F = None
        self.r: D = None
        self.o: F = None
        self.t: C = None
        self.p: H = None
        self.s: D = None
        self.txt = txt

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

i = A("i")
g = B("g")
e = C("e")
a = D("a")
j = E("j")
d = F("d")
l = G("l")
b = H("b")
m = G("m")
n = C("n")

i.z = b
i.r = b
g.r = e
e.y = g
e.t = b
a.z = j
j.z = a
j.v = a
j.r = a
j.y = e
j.q = l
d.p = i
d.x = m
d.s = b
l.q = d
l.y = d
l.o = d
l.w = n
l.r = a
l.s = a
l.t = e
l.p = b
b.w = g
b.p = g
m.q = d
m.y = d
m.o = d
m.w = e
m.t = e
m.r = a
m.s = a
m.p = b
n.y = g
n.t = b
assert m.p.w.r.y.r.txt == "e"