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

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: F = None
        self.z: A = None
        self.x: A = None
        self.w: G = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: B = None
        self.w: D = None
        self.v: D = None
        self.u: F = None
        self.q: D = None
        self.y: G = None
        self.txt = txt

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

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

n = A("n")
d = B("d")
f = C("f")
e = D("e")
b = E("b")
g = F("g")
j = G("j")
i = B("i")

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: F = None
        self.z: A = None
        self.x: A = None
        self.w: G = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: B = None
        self.w: D = None
        self.v: D = None
        self.u: F = None
        self.q: D = None
        self.y: G = None
        self.txt = txt

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

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

n = A("n")
d = B("d")
f = C("f")
e = D("e")
b = E("b")
g = F("g")
j = G("j")
i = B("i")

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