class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

i = A("i")
g = B("g")
l = C("l")
n = D("n")
d = E("d")
c = F("c")
k = G("k")

i.t = d
i.q = n
g.q = c
g.z = d
g.o = k
l.w = k
l.v = c
n.o = i
n.z = i
n.y = l
n.s = l
n.v = g
d.u = l
d.v = k
c.r = n
c.s = d
c.y = k
k.o = d
assert n.v.o.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

i = A("i")
g = B("g")
l = C("l")
n = D("n")
d = E("d")
c = F("c")
k = G("k")

i.t = d
i.q = n
g.q = c
g.z = d
g.o = k
l.w = k
l.v = c
n.o = i
n.z = i
n.y = l
n.s = l
n.v = g
d.u = l
d.v = k
c.r = n
c.s = d
c.y = k
k.o = d
assert n.v.o.o.v.txt == "k"