class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: F = None
        self.w: B = None
        self.v: D = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

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

a = A("a")
c = B("c")
i = C("i")
n = D("n")
g = E("g")
j = F("j")
d = F("d")

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

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

a = A("a")
c = B("c")
i = C("i")
n = D("n")
g = E("g")
j = F("j")
d = F("d")

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