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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: D = None
        self.t: C = None
        self.u: A = None
        self.v: B = None
        self.z: A = None
        self.txt = txt

k = A("k")
c = B("c")
i = C("i")
g = D("g")
l = E("l")
e = F("e")

k.r = i
c.q = l
i.z = c
i.p = g
g.r = k
g.o = e
g.w = i
l.o = e
e.s = g
e.q = g
e.t = i
e.u = k
e.z = k
e.v = c
assert l.o.s.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: D = None
        self.t: C = None
        self.u: A = None
        self.v: B = None
        self.z: A = None
        self.txt = txt

k = A("k")
c = B("c")
i = C("i")
g = D("g")
l = E("l")
e = F("e")

k.r = i
c.q = l
i.z = c
i.p = g
g.r = k
g.o = e
g.w = i
l.o = e
e.s = g
e.q = g
e.t = i
e.u = k
e.z = k
e.v = c
assert l.o.s.r.r.txt == "i"