class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: F = None
        self.y: C = None
        self.z: D = None
        self.u: D = None
        self.r: G = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: E = None
        self.q: G = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: A = None
        self.q: E = None
        self.p: B = None
        self.y: A = None
        self.s: C = None
        self.txt = txt

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

j.t = l
j.v = l
j.y = g
j.z = b
j.u = b
j.r = f
j.q = f
d.r = g
d.q = g
d.x = b
d.t = b
d.u = a
d.o = f
g.x = l
g.y = a
g.q = f
g.w = f
b.y = f
b.x = f
a.z = j
a.u = j
a.o = b
a.p = d
l.t = f
f.r = g
f.s = g
f.z = j
f.y = j
f.q = a
f.p = d
assert b.x.p.o.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: F = None
        self.y: C = None
        self.z: D = None
        self.u: D = None
        self.r: G = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: E = None
        self.q: G = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: A = None
        self.q: E = None
        self.p: B = None
        self.y: A = None
        self.s: C = None
        self.txt = txt

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

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