class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: F = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: B = None
        self.y: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: B = None
        self.y: A = None
        self.t: A = None
        self.txt = txt

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

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