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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: F = None
        self.t: F = None
        self.y: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: A = None
        self.txt = txt

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

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

c = A("c")
h = B("h")
f = C("f")
i = D("i")
d = E("d")
a = F("a")
l = G("l")
n = H("n")
b = G("b")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: F = None
        self.t: F = None
        self.y: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: A = None
        self.txt = txt

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

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

c = A("c")
h = B("h")
f = C("f")
i = D("i")
d = E("d")
a = F("a")
l = G("l")
n = H("n")
b = G("b")

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