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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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