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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: D = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: E = None
        self.z: C = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: D = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: E = None
        self.z: C = None
        self.x: H = None
        self.txt = txt

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

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

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