class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: B = None
        self.q: D = None
        self.r: C = 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.o: A = None
        self.z: F = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: B = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: E = None
        self.z: C = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: B = None
        self.o: E = None
        self.v: A = None
        self.txt = txt

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

l.s = h
l.q = h
l.t = a
l.r = c
k.z = j
c.o = l
c.z = n
c.y = h
h.p = n
h.v = k
h.z = k
j.r = l
j.x = c
j.u = b
n.t = h
n.w = j
n.z = c
n.q = c
b.p = l
b.v = l
b.q = a
b.o = j
a.z = j
assert j.u.q.z.x.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: B = None
        self.q: D = None
        self.r: C = 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.o: A = None
        self.z: F = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: B = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: E = None
        self.z: C = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: B = None
        self.o: E = None
        self.v: A = None
        self.txt = txt

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

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