class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: F = None
        self.w: E = None
        self.v: C = None
        self.r: C = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: G = None
        self.w: C = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: E = None
        self.s: B = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: G = None
        self.t: G = None
        self.txt = txt

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

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

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

a.u = h
a.w = h
a.z = h
a.p = l
a.v = i
a.r = i
j.x = i
j.w = i
j.r = g
j.o = e
i.v = e
i.r = h
i.s = j
i.t = l
e.p = j
h.o = j
h.v = g
h.t = g
l.w = i
l.v = e
l.u = e
l.z = g
l.t = j
g.z = h
assert l.w.r.o.r.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: F = None
        self.w: E = None
        self.v: C = None
        self.r: C = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: G = None
        self.w: C = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: E = None
        self.s: B = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: G = None
        self.t: G = None
        self.txt = txt

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

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

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

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