class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: C = None
        self.r: F = None
        self.q: F = None
        self.y: B = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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