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

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

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

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

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

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

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

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

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

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

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

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

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

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

i.z = f
i.x = f
i.y = h
i.w = h
a.x = e
a.u = e
a.q = f
f.w = j
h.x = g
h.s = a
h.u = d
h.y = i
j.q = a
j.z = f
j.x = f
j.r = h
j.y = d
d.z = a
d.y = i
d.v = h
e.z = a
e.y = i
e.v = h
g.q = a
g.z = f
g.x = f
g.r = h
g.y = d
assert j.y.z.u.z.txt == "a"