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

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

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

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

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

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

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

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

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

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

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

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

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

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

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