class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

e.x = l
e.y = j
e.r = d
n.o = a
k.x = n
k.z = d
k.q = g
g.z = n
g.v = d
j.z = n
d.x = a
d.r = f
a.w = f
a.o = f
a.r = n
a.z = j
a.v = k
a.s = k
l.x = n
l.z = d
l.q = g
f.z = n
f.v = d
assert d.r.v.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

e.x = l
e.y = j
e.r = d
n.o = a
k.x = n
k.z = d
k.q = g
g.z = n
g.v = d
j.z = n
d.x = a
d.r = f
a.w = f
a.o = f
a.r = n
a.z = j
a.v = k
a.s = k
l.x = n
l.z = d
l.q = g
f.z = n
f.v = d
assert d.r.v.x.w.txt == "f"