class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: G = None
        self.t: B = None
        self.u: H = None
        self.x: H = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: F = None
        self.t: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: G = None
        self.w: F = None
        self.r: B = None
        self.z: B = None
        self.txt = txt

d = A("d")
b = B("b")
e = C("e")
g = D("g")
f = E("f")
l = F("l")
h = G("h")
m = H("m")
a = C("a")

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: F = None
        self.t: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: G = None
        self.w: F = None
        self.r: B = None
        self.z: B = None
        self.txt = txt

d = A("d")
b = B("b")
e = C("e")
g = D("g")
f = E("f")
l = F("l")
h = G("h")
m = H("m")
a = C("a")

d.p = b
d.t = b
d.w = b
d.s = h
d.u = m
d.x = m
b.z = e
b.x = d
e.p = l
e.z = l
e.t = d
g.o = a
g.x = m
f.u = d
f.q = d
f.v = d
f.r = g
f.z = e
f.o = m
l.q = m
l.r = h
h.x = g
h.u = g
h.p = f
h.q = l
h.z = l
h.s = a
m.s = f
m.y = h
m.w = l
m.r = b
m.z = b
a.p = l
a.z = l
a.t = d
assert d.s.p.r.x.s.u.s.txt == "h"