class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: D = None
        self.u: F = None
        self.w: H = None
        self.v: E = None
        self.q: B = None
        self.z: F = None
        self.x: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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