class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: D = None
        self.q: G = None
        self.t: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: C = None
        self.x: E = None
        self.u: G = None
        self.v: F = None
        self.o: A = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: C = None
        self.r: C = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: C = None
        self.x: E = None
        self.u: G = None
        self.v: F = None
        self.o: A = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: C = None
        self.r: C = None
        self.z: G = None
        self.txt = txt

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

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

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

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