class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: E = None
        self.t: B = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

g.u = f
g.p = i
g.t = k
g.q = m
k.x = i
k.z = g
k.o = c
k.w = n
m.x = g
m.u = f
n.r = c
n.w = c
n.p = g
n.v = g
i.t = g
i.w = g
i.z = k
f.t = i
c.x = g
c.u = f
assert n.w.x.u.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: E = None
        self.t: B = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

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