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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: D = None
        self.o: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

d = A("d")
m = B("m")
k = C("k")
g = D("g")
i = E("i")
b = F("b")
n = B("n")
e = A("e")
c = B("c")
a = E("a")

d.r = g
d.s = k
d.w = a
d.q = a
d.v = b
d.u = n
m.t = g
m.q = g
m.o = b
m.w = e
k.q = c
k.z = g
k.y = a
g.t = d
i.o = g
i.v = n
i.w = b
b.y = a
b.r = d
b.o = k
n.t = g
n.q = g
n.o = b
n.w = e
e.r = g
e.s = k
e.w = a
e.v = b
e.u = c
e.q = i
c.t = g
c.q = g
c.o = b
c.w = e
a.o = g
a.v = m
a.w = b
assert k.q.w.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: C = None
        self.w: E = None
        self.v: F = None
        self.u: B = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: D = None
        self.o: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

d = A("d")
m = B("m")
k = C("k")
g = D("g")
i = E("i")
b = F("b")
n = B("n")
e = A("e")
c = B("c")
a = E("a")

d.r = g
d.s = k
d.w = a
d.q = a
d.v = b
d.u = n
m.t = g
m.q = g
m.o = b
m.w = e
k.q = c
k.z = g
k.y = a
g.t = d
i.o = g
i.v = n
i.w = b
b.y = a
b.r = d
b.o = k
n.t = g
n.q = g
n.o = b
n.w = e
e.r = g
e.s = k
e.w = a
e.v = b
e.u = c
e.q = i
c.t = g
c.q = g
c.o = b
c.w = e
a.o = g
a.v = m
a.w = b
assert k.q.w.s.q.txt == "c"