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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: B = None
        self.s: A = None
        self.q: F = None
        self.r: B = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: E = None
        self.t: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: B = None
        self.s: A = None
        self.q: F = None
        self.r: B = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: E = None
        self.t: G = None
        self.txt = txt

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

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