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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: E = None
        self.v: C = None
        self.t: C = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: D = None
        self.q: E = None
        self.y: A = None
        self.w: A = None
        self.txt = txt

h = A("h")
g = B("g")
d = C("d")
n = D("n")
k = E("k")
m = F("m")
l = G("l")
a = H("a")
c = A("c")
b = C("b")

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: E = None
        self.v: C = None
        self.t: C = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: D = None
        self.q: E = None
        self.y: A = None
        self.w: A = None
        self.txt = txt

h = A("h")
g = B("g")
d = C("d")
n = D("n")
k = E("k")
m = F("m")
l = G("l")
a = H("a")
c = A("c")
b = C("b")

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