class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: C = None
        self.p: F = None
        self.w: B = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: A = None
        self.z: D = None
        self.txt = txt

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

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

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

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

m = A("m")
h = B("h")
f = C("f")
j = D("j")
k = E("k")
n = F("n")
g = B("g")

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: A = None
        self.z: D = None
        self.txt = txt

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

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

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

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

m = A("m")
h = B("h")
f = C("f")
j = D("j")
k = E("k")
n = F("n")
g = B("g")

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