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

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

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

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

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

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

g = A("g")
l = B("l")
a = C("a")
c = D("c")
e = E("e")
k = F("k")

g.o = l
g.p = l
g.s = k
l.t = c
l.x = c
l.v = k
l.r = a
l.p = g
a.w = g
a.v = g
c.r = e
c.u = a
e.t = k
k.r = a
k.u = g
k.p = g
k.w = l
k.o = e
assert c.u.w.p.r.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: F = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

g = A("g")
l = B("l")
a = C("a")
c = D("c")
e = E("e")
k = F("k")

g.o = l
g.p = l
g.s = k
l.t = c
l.x = c
l.v = k
l.r = a
l.p = g
a.w = g
a.v = g
c.r = e
c.u = a
e.t = k
k.r = a
k.u = g
k.p = g
k.w = l
k.o = e
assert c.u.w.p.r.v.s.txt == "k"