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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: G = None
        self.v: H = None
        self.t: E = None
        self.u: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: A = None
        self.v: C = None
        self.x: A = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: C = None
        self.x: C = None
        self.v: C = None
        self.t: G = None
        self.s: H = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: E = None
        self.u: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: G = None
        self.v: H = None
        self.t: E = None
        self.u: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: A = None
        self.v: C = None
        self.x: A = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: C = None
        self.x: C = None
        self.v: C = None
        self.t: G = None
        self.s: H = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: E = None
        self.u: B = None
        self.txt = txt

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

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

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