class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: A = None
        self.y: F = None
        self.t: E = None
        self.u: A = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: A = None
        self.y: A = None
        self.txt = txt

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

m = A("m")
k = B("k")
b = C("b")
i = D("i")
g = E("g")
j = F("j")

m.z = i
k.x = j
b.o = i
b.x = i
b.s = m
b.u = m
b.y = j
b.t = g
i.s = b
i.y = b
i.z = g
i.r = g
g.o = k
g.s = m
g.y = m
j.v = g
assert g.o.x.v.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: A = None
        self.y: F = None
        self.t: E = None
        self.u: A = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: A = None
        self.y: A = None
        self.txt = txt

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

m = A("m")
k = B("k")
b = C("b")
i = D("i")
g = E("g")
j = F("j")

m.z = i
k.x = j
b.o = i
b.x = i
b.s = m
b.u = m
b.y = j
b.t = g
i.s = b
i.y = b
i.z = g
i.r = g
g.o = k
g.s = m
g.y = m
j.v = g
assert g.o.x.v.y.z.txt == "i"