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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

e = A("e")
d = B("d")
f = C("f")
h = D("h")
i = E("i")
c = F("c")
j = G("j")
n = E("n")
k = F("k")

e.x = n
e.y = n
e.z = f
d.r = f
d.s = h
d.v = h
f.o = e
f.r = e
f.s = h
f.x = i
f.u = d
f.y = j
h.s = n
i.w = h
i.v = j
i.r = d
i.z = d
i.t = f
i.s = f
i.p = n
c.u = i
j.w = d
n.w = h
n.v = j
n.r = d
n.z = d
n.t = f
n.s = f
n.p = i
k.u = i
assert n.z.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: E = None
        self.z: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

e = A("e")
d = B("d")
f = C("f")
h = D("h")
i = E("i")
c = F("c")
j = G("j")
n = E("n")
k = F("k")

e.x = n
e.y = n
e.z = f
d.r = f
d.s = h
d.v = h
f.o = e
f.r = e
f.s = h
f.x = i
f.u = d
f.y = j
h.s = n
i.w = h
i.v = j
i.r = d
i.z = d
i.t = f
i.s = f
i.p = n
c.u = i
j.w = d
n.w = h
n.v = j
n.r = d
n.z = d
n.t = f
n.s = f
n.p = i
k.u = i
assert n.z.r.r.txt == "e"