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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: G = None
        self.q: A = None
        self.o: D = None
        self.u: C = None
        self.x: B = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: D = None
        self.u: E = None
        self.q: A = None
        self.w: D = None
        self.x: F = None
        self.r: E = None
        self.txt = txt

j = A("j")
e = B("e")
h = C("h")
g = D("g")
l = E("l")
n = F("n")
d = G("d")
m = E("m")

j.o = g
e.r = n
h.s = l
h.u = n
h.y = j
g.y = e
l.s = h
l.p = e
n.s = e
n.x = e
n.v = d
n.q = j
n.o = g
n.u = h
n.t = h
d.y = e
d.t = g
d.w = g
d.u = m
d.r = m
d.q = j
d.x = n
m.s = h
m.p = e
assert g.y.r.o.y.r.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: G = None
        self.q: A = None
        self.o: D = None
        self.u: C = None
        self.x: B = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: D = None
        self.u: E = None
        self.q: A = None
        self.w: D = None
        self.x: F = None
        self.r: E = None
        self.txt = txt

j = A("j")
e = B("e")
h = C("h")
g = D("g")
l = E("l")
n = F("n")
d = G("d")
m = E("m")

j.o = g
e.r = n
h.s = l
h.u = n
h.y = j
g.y = e
l.s = h
l.p = e
n.s = e
n.x = e
n.v = d
n.q = j
n.o = g
n.u = h
n.t = h
d.y = e
d.t = g
d.w = g
d.u = m
d.r = m
d.q = j
d.x = n
m.s = h
m.p = e
assert g.y.r.o.y.r.s.txt == "e"