class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: D = None
        self.o: A = None
        self.y: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: E = None
        self.t: E = None
        self.v: C = None
        self.p: A = None
        self.u: E = None
        self.txt = txt

a = A("a")
e = B("e")
i = C("i")
n = D("n")
g = E("g")
j = F("j")
k = G("k")
h = A("h")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: E = None
        self.t: E = None
        self.v: C = None
        self.p: A = None
        self.u: E = None
        self.txt = txt

a = A("a")
e = B("e")
i = C("i")
n = D("n")
g = E("g")
j = F("j")
k = G("k")
h = A("h")

a.u = k
a.x = n
a.o = h
a.y = g
e.r = j
e.w = k
i.y = e
i.z = j
n.z = e
n.p = a
g.p = h
g.q = n
g.o = k
j.p = i
j.o = i
k.y = e
k.s = g
k.t = g
k.u = g
k.v = i
k.p = a
h.u = k
h.x = n
h.o = a
h.y = g
assert j.o.y.w.p.y.p.x.txt == "n"