class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: D = None
        self.r: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: D = None
        self.v: D = None
        self.txt = txt

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

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

a.q = b
a.y = c
a.r = g
g.w = m
g.u = a
g.v = b
g.x = e
e.t = a
e.s = j
e.x = m
j.v = g
j.r = c
j.y = m
j.s = h
k.s = m
k.r = j
k.v = j
i.q = j
i.o = a
m.q = j
m.o = a
h.s = m
h.r = j
h.v = j
b.w = i
b.u = a
b.v = g
b.x = e
c.v = g
c.r = j
c.y = m
c.s = k
assert c.s.v.s.s.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: D = None
        self.r: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: D = None
        self.v: D = None
        self.txt = txt

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

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

a.q = b
a.y = c
a.r = g
g.w = m
g.u = a
g.v = b
g.x = e
e.t = a
e.s = j
e.x = m
j.v = g
j.r = c
j.y = m
j.s = h
k.s = m
k.r = j
k.v = j
i.q = j
i.o = a
m.q = j
m.o = a
h.s = m
h.r = j
h.v = j
b.w = i
b.u = a
b.v = g
b.x = e
c.v = g
c.r = j
c.y = m
c.s = k
assert c.s.v.s.s.q.r.txt == "c"