class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: E = None
        self.u: F = None
        self.o: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: G = None
        self.z: A = None
        self.w: G = None
        self.s: F = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: E = None
        self.q: G = None
        self.u: A = None
        self.p: B = None
        self.r: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: G = None
        self.z: A = None
        self.w: G = None
        self.s: F = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: E = None
        self.q: G = None
        self.u: A = None
        self.p: B = None
        self.r: A = None
        self.z: E = None
        self.txt = txt

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

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

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