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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: D = None
        self.p: A = None
        self.s: A = None
        self.o: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: D = None
        self.p: A = None
        self.s: A = None
        self.o: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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