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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: B = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: C = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: B = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: C = None
        self.v: B = None
        self.txt = txt

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

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

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

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