class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: C = None
        self.x: C = None
        self.y: F = None
        self.s: G = None
        self.u: G = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: G = None
        self.x: H = None
        self.t: B = None
        self.q: H = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: B = None
        self.p: A = None
        self.v: F = None
        self.t: E = None
        self.w: H = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: F = None
        self.s: F = None
        self.r: A = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: B = None
        self.z: H = None
        self.q: D = None
        self.o: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: F = None
        self.u: F = None
        self.v: E = None
        self.y: F = None
        self.z: E = None
        self.txt = txt

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

l.z = b
l.p = m
l.x = m
l.y = d
l.r = d
l.s = c
l.u = c
a.q = j
a.z = i
a.u = b
m.s = b
m.p = c
m.x = j
m.q = j
m.t = a
m.z = d
i.u = a
i.r = a
i.p = l
i.x = l
i.v = d
i.t = b
i.w = j
b.p = m
b.o = d
b.s = d
b.r = l
b.w = j
d.u = c
d.s = a
d.z = j
d.q = i
d.o = m
c.p = a
j.o = d
j.w = d
j.u = d
j.y = d
j.v = b
j.z = b
assert b.p.z.u.p.z.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: C = None
        self.x: C = None
        self.y: F = None
        self.s: G = None
        self.u: G = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: G = None
        self.x: H = None
        self.t: B = None
        self.q: H = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: B = None
        self.p: A = None
        self.v: F = None
        self.t: E = None
        self.w: H = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: F = None
        self.s: F = None
        self.r: A = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: B = None
        self.z: H = None
        self.q: D = None
        self.o: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: F = None
        self.u: F = None
        self.v: E = None
        self.y: F = None
        self.z: E = None
        self.txt = txt

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

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