class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: F = None
        self.s: D = None
        self.v: D = None
        self.t: A = None
        self.u: A = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: E = None
        self.q: A = None
        self.s: D = None
        self.w: B = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: F = None
        self.s: D = None
        self.v: D = None
        self.t: A = None
        self.u: A = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: E = None
        self.q: A = None
        self.s: D = None
        self.w: B = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.txt = txt

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

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