class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: D = None
        self.o: B = None
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.t: F = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: A = None
        self.t: A = None
        self.u: C = None
        self.v: D = None
        self.y: B = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.t: F = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: A = None
        self.t: A = None
        self.u: C = None
        self.v: D = None
        self.y: B = None
        self.o: C = None
        self.txt = txt

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

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

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

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