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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: A = None
        self.v: E = None
        self.r: E = None
        self.o: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: A = None
        self.v: E = None
        self.r: E = None
        self.o: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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