class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: E = None
        self.r: G = None
        self.s: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: B = None
        self.x: F = None
        self.o: B = None
        self.s: B = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.o: D = None
        self.t: G = None
        self.u: C = None
        self.txt = txt

n = A("n")
k = B("k")
g = C("g")
h = D("h")
c = E("c")
m = F("m")
e = G("e")
f = G("f")
i = E("i")

n.t = h
n.u = i
n.r = e
n.s = f
k.t = g
k.o = h
k.y = n
g.r = k
h.r = n
h.t = g
c.t = n
c.y = k
c.o = k
c.s = k
c.x = m
c.q = e
m.o = c
m.s = i
e.z = c
e.v = h
e.o = h
e.t = f
e.u = g
f.z = i
f.v = h
f.o = h
f.t = e
f.u = g
i.t = n
i.y = k
i.o = k
i.s = k
i.x = m
i.q = f
assert e.t.u.r.y.t.r.r.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: E = None
        self.r: G = None
        self.s: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: B = None
        self.x: F = None
        self.o: B = None
        self.s: B = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.o: D = None
        self.t: G = None
        self.u: C = None
        self.txt = txt

n = A("n")
k = B("k")
g = C("g")
h = D("h")
c = E("c")
m = F("m")
e = G("e")
f = G("f")
i = E("i")

n.t = h
n.u = i
n.r = e
n.s = f
k.t = g
k.o = h
k.y = n
g.r = k
h.r = n
h.t = g
c.t = n
c.y = k
c.o = k
c.s = k
c.x = m
c.q = e
m.o = c
m.s = i
e.z = c
e.v = h
e.o = h
e.t = f
e.u = g
f.z = i
f.v = h
f.o = h
f.t = e
f.u = g
i.t = n
i.y = k
i.o = k
i.s = k
i.x = m
i.q = f
assert e.t.u.r.y.t.r.r.v.t.txt == "g"