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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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