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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: B = None
        self.y: D = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.y: D = None
        self.u: A = None
        self.txt = txt

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

h = A("h")
l = B("l")
j = C("j")
m = D("m")
e = E("e")
n = F("n")
c = G("c")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: B = None
        self.y: D = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: C = None
        self.y: D = None
        self.u: A = None
        self.txt = txt

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

h = A("h")
l = B("l")
j = C("j")
m = D("m")
e = E("e")
n = F("n")
c = G("c")

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