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

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

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

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

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

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

n = A("n")
h = B("h")
j = C("j")
e = D("e")
m = E("m")
g = F("g")
d = A("d")
c = B("c")

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

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

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

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

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

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

n = A("n")
h = B("h")
j = C("j")
e = D("e")
m = E("m")
g = F("g")
d = A("d")
c = B("c")

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