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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: A = None
        self.r: D = None
        self.v: C = None
        self.t: C = None
        self.p: C = None
        self.w: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: A = None
        self.s: A = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: A = None
        self.u: E = None
        self.y: H = None
        self.q: G = None
        self.x: D = None
        self.t: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: A = None
        self.r: D = None
        self.v: C = None
        self.t: C = None
        self.p: C = None
        self.w: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: A = None
        self.s: A = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: A = None
        self.u: E = None
        self.y: H = None
        self.q: G = None
        self.x: D = None
        self.t: F = None
        self.txt = txt

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

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

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