class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: C = None
        self.q: B = None
        self.v: C = None
        self.s: C = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

a = A("a")
j = B("j")
k = C("k")
n = D("n")
l = E("l")
f = F("f")
m = G("m")

a.r = j
a.q = j
a.s = n
j.u = m
j.w = f
j.q = f
j.t = f
j.z = l
j.s = k
j.y = n
k.q = a
n.v = j
n.z = l
n.x = l
n.p = m
l.r = n
l.t = k
l.v = k
l.s = k
l.x = k
l.q = j
f.v = a
f.o = k
m.t = a
assert l.r.x.r.v.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: C = None
        self.q: B = None
        self.v: C = None
        self.s: C = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

a = A("a")
j = B("j")
k = C("k")
n = D("n")
l = E("l")
f = F("f")
m = G("m")

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