class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.q: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.q: B = None
        self.o: F = None
        self.txt = txt

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

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

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