class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: D = None
        self.t: D = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: D = None
        self.t: D = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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