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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: F = None
        self.t: A = None
        self.v: G = None
        self.q: E = None
        self.o: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: E = None
        self.z: D = None
        self.q: A = None
        self.txt = txt

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

j = A("j")
b = B("b")
d = C("d")
a = D("a")
h = E("h")
n = F("n")
e = G("e")

j.x = e
j.y = h
j.w = n
j.u = d
b.w = a
b.o = a
b.s = n
b.t = j
b.v = e
b.q = h
d.y = h
d.v = e
a.s = d
a.z = e
a.u = b
a.y = h
h.s = d
h.w = d
h.o = n
h.z = n
h.x = n
h.t = b
h.v = e
n.v = h
n.u = h
n.z = a
n.q = j
e.u = d
assert d.y.v.u.v.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: E = None
        self.w: F = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: F = None
        self.t: A = None
        self.v: G = None
        self.q: E = None
        self.o: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: E = None
        self.z: D = None
        self.q: A = None
        self.txt = txt

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

j = A("j")
b = B("b")
d = C("d")
a = D("a")
h = E("h")
n = F("n")
e = G("e")

j.x = e
j.y = h
j.w = n
j.u = d
b.w = a
b.o = a
b.s = n
b.t = j
b.v = e
b.q = h
d.y = h
d.v = e
a.s = d
a.z = e
a.u = b
a.y = h
h.s = d
h.w = d
h.o = n
h.z = n
h.x = n
h.t = b
h.v = e
n.v = h
n.u = h
n.z = a
n.q = j
e.u = d
assert d.y.v.u.v.u.y.txt == "h"