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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: B = None
        self.s: D = None
        self.o: E = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: B = None
        self.s: D = None
        self.o: E = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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