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

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

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

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

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

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

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

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

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

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

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

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

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

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

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