class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: B = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: A = None
        self.p: A = None
        self.z: B = None
        self.q: E = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: A = None
        self.p: A = None
        self.z: B = None
        self.q: E = None
        self.s: C = None
        self.txt = txt

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

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

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

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