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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: A = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: A = None
        self.z: D = None
        self.txt = txt

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

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

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

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