class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: D = None
        self.y: B = None
        self.s: B = None
        self.o: F = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: E = None
        self.z: E = None
        self.o: E = None
        self.y: A = None
        self.w: C = None
        self.p: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: D = None
        self.z: E = None
        self.s: D = None
        self.txt = txt

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

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

j.v = k
j.t = h
j.y = d
j.s = d
j.r = d
j.o = f
d.q = h
d.u = l
d.z = l
d.o = l
d.p = l
d.y = j
d.w = k
k.x = c
k.t = j
k.r = j
k.p = h
k.s = h
k.q = l
h.p = c
h.u = l
l.u = j
l.z = h
l.y = f
l.o = b
l.q = d
f.r = j
f.o = h
f.s = h
f.z = l
b.v = j
c.x = k
c.t = j
c.r = j
c.p = h
c.s = h
c.q = l
assert c.x.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: D = None
        self.y: B = None
        self.s: B = None
        self.o: F = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: E = None
        self.z: E = None
        self.o: E = None
        self.y: A = None
        self.w: C = None
        self.p: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: D = None
        self.z: E = None
        self.s: D = None
        self.txt = txt

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

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

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