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

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: C = None
        self.y: F = None
        self.t: A = None
        self.x: B = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: A = None
        self.u: E = None
        self.txt = txt

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

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

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

n = A("n")
d = B("d")
a = C("a")
h = D("h")
l = E("l")
b = F("b")
i = F("i")
g = B("g")
m = F("m")
f = E("f")

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

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: C = None
        self.y: F = None
        self.t: A = None
        self.x: B = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: A = None
        self.u: E = None
        self.txt = txt

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

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

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

n = A("n")
d = B("d")
a = C("a")
h = D("h")
l = E("l")
b = F("b")
i = F("i")
g = B("g")
m = F("m")
f = E("f")

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