class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: B = None
        self.o: B = 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.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: A = None
        self.w: G = None
        self.y: B = None
        self.z: G = None
        self.txt = txt

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

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

e = A("e")
f = B("f")
c = C("c")
g = D("g")
j = E("j")
a = F("a")
d = G("d")

e.u = j
e.v = f
e.o = f
f.r = a
c.r = e
g.y = d
g.v = j
g.p = a
j.o = a
j.v = e
j.w = d
j.z = d
j.y = f
a.u = f
a.q = f
a.s = c
a.p = g
a.x = g
a.t = d
d.q = f
d.s = f
d.o = j
d.x = j
d.t = g
d.w = a
d.z = e
assert d.t.p.t.z.o.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: B = None
        self.o: B = 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.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: A = None
        self.w: G = None
        self.y: B = None
        self.z: G = None
        self.txt = txt

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

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

e = A("e")
f = B("f")
c = C("c")
g = D("g")
j = E("j")
a = F("a")
d = G("d")

e.u = j
e.v = f
e.o = f
f.r = a
c.r = e
g.y = d
g.v = j
g.p = a
j.o = a
j.v = e
j.w = d
j.z = d
j.y = f
a.u = f
a.q = f
a.s = c
a.p = g
a.x = g
a.t = d
d.q = f
d.s = f
d.o = j
d.x = j
d.t = g
d.w = a
d.z = e
assert d.t.p.t.z.o.r.x.txt == "g"