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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: H = None
        self.v: G = None
        self.s: H = None
        self.u: G = None
        self.q: D = None
        self.o: B = None
        self.x: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: A = None
        self.p: E = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: H = None
        self.v: G = None
        self.s: H = None
        self.u: G = None
        self.q: D = None
        self.o: B = None
        self.x: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: A = None
        self.p: E = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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