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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: H = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: H = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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