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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: E = None
        self.w: D = None
        self.t: B = None
        self.txt = txt

m = A("m")
f = B("f")
h = C("h")
k = D("k")
g = E("g")
l = F("l")
d = A("d")
e = F("e")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: E = None
        self.w: D = None
        self.t: B = None
        self.txt = txt

m = A("m")
f = B("f")
h = C("h")
k = D("k")
g = E("g")
l = F("l")
d = A("d")
e = F("e")

m.t = h
m.p = h
m.q = d
m.s = f
m.u = f
m.v = g
f.o = g
h.x = k
h.y = g
h.r = g
k.w = e
g.s = e
l.v = e
l.p = g
l.w = k
l.t = f
d.t = h
d.p = h
d.q = m
d.s = f
d.u = f
d.v = g
e.v = l
e.p = g
e.w = k
e.t = f
assert k.w.v.p.s.t.o.s.w.txt == "k"