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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: E = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: F = None
        self.v: H = None
        self.q: B = None
        self.s: F = None
        self.x: D = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: B = None
        self.p: H = None
        self.x: B = None
        self.w: C = None
        self.z: B = None
        self.r: D = None
        self.v: H = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: E = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: F = None
        self.v: H = None
        self.q: B = None
        self.s: F = None
        self.x: D = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: B = None
        self.p: H = None
        self.x: B = None
        self.w: C = None
        self.z: B = None
        self.r: D = None
        self.v: H = None
        self.txt = txt

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

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

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

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

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