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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: C = None
        self.o: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: C = None
        self.o: E = None
        self.txt = txt

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

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

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

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