class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: B = None
        self.v: F = None
        self.p: C = None
        self.z: D = None
        self.txt = txt

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

n.t = l
l.t = e
l.x = b
l.u = b
l.p = h
l.w = c
g.z = c
g.w = c
g.u = c
g.v = n
g.p = n
g.x = l
g.s = f
c.w = k
c.u = f
b.p = f
b.u = l
b.v = l
e.p = f
f.r = h
k.x = g
k.p = g
k.o = l
k.v = e
k.z = c
h.t = l
m.p = f
assert e.p.r.t.p.t.p.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: B = None
        self.v: F = None
        self.p: C = None
        self.z: D = None
        self.txt = txt

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

n.t = l
l.t = e
l.x = b
l.u = b
l.p = h
l.w = c
g.z = c
g.w = c
g.u = c
g.v = n
g.p = n
g.x = l
g.s = f
c.w = k
c.u = f
b.p = f
b.u = l
b.v = l
e.p = f
f.r = h
k.x = g
k.p = g
k.o = l
k.v = e
k.z = c
h.t = l
m.p = f
assert e.p.r.t.p.t.p.t.p.txt == "h"