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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: C = None
        self.u: F = None
        self.y: E = None
        self.o: A = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: F = None
        self.q: C = None
        self.p: B = None
        self.y: B = None
        self.r: C = None
        self.txt = txt

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

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

k.s = l
g.s = a
g.v = l
g.y = c
c.z = k
c.q = k
a.t = f
a.u = f
a.r = c
a.v = c
a.y = l
a.o = k
l.w = f
l.s = f
l.q = c
l.r = c
l.p = g
l.y = g
f.o = k
f.r = k
assert c.q.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: C = None
        self.u: F = None
        self.y: E = None
        self.o: A = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: F = None
        self.q: C = None
        self.p: B = None
        self.y: B = None
        self.r: C = None
        self.txt = txt

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

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

k.s = l
g.s = a
g.v = l
g.y = c
c.z = k
c.q = k
a.t = f
a.u = f
a.r = c
a.v = c
a.y = l
a.o = k
l.w = f
l.s = f
l.q = c
l.r = c
l.p = g
l.y = g
f.o = k
f.r = k
assert c.q.s.r.txt == "c"