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

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

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

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

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

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

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

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

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

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

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

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

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

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

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