class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: D = None
        self.x: F = None
        self.z: F = None
        self.p: G = None
        self.r: C = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: H = None
        self.p: C = None
        self.y: C = None
        self.o: H = None
        self.v: B = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: C = None
        self.z: B = None
        self.t: B = None
        self.r: A = None
        self.q: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: H = None
        self.p: C = None
        self.y: C = None
        self.o: H = None
        self.v: B = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: C = None
        self.z: B = None
        self.t: B = None
        self.r: A = None
        self.q: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: D = None
        self.txt = txt

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

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