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

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

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

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

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

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

f = A("f")
b = B("b")
g = C("g")
h = D("h")
i = E("i")
k = F("k")
c = E("c")
a = B("a")

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

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

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

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

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

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

f = A("f")
b = B("b")
g = C("g")
h = D("h")
i = E("i")
k = F("k")
c = E("c")
a = B("a")

f.w = g
f.t = g
f.x = b
b.x = g
b.o = g
b.r = g
b.p = k
b.w = k
b.u = h
g.o = f
g.p = f
g.w = a
h.u = g
h.z = k
h.s = k
h.y = i
h.v = i
h.w = f
i.x = h
i.r = k
k.w = c
c.x = h
c.r = k
a.x = g
a.o = g
a.r = g
a.p = k
a.w = k
a.u = h
assert k.w.x.z.w.r.w.txt == "c"