class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: B = None
        self.s: C = None
        self.w: G = None
        self.v: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: A = None
        self.x: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: A = None
        self.r: G = None
        self.txt = txt

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

k.o = f
k.q = c
k.v = c
k.s = a
k.w = d
c.o = b
c.z = f
c.x = k
c.r = a
a.r = b
a.o = i
i.w = k
b.w = i
b.p = k
b.x = k
f.t = c
d.z = l
d.r = l
d.s = k
e.o = f
e.q = c
e.v = c
e.s = a
e.w = l
l.z = d
l.r = d
l.s = k
assert c.o.x.w.s.w.s.s.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: B = None
        self.s: C = None
        self.w: G = None
        self.v: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: A = None
        self.x: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: A = None
        self.r: G = None
        self.txt = txt

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

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