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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: H = None
        self.x: E = None
        self.t: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: F = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: B = None
        self.v: E = None
        self.t: B = None
        self.z: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: H = None
        self.x: E = None
        self.t: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: F = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: B = None
        self.v: E = None
        self.t: B = None
        self.z: B = None
        self.txt = txt

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

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