class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: E = None
        self.z: H = None
        self.s: E = None
        self.q: F = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: G = None
        self.x: H = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: G = None
        self.o: F = None
        self.z: C = None
        self.r: H = None
        self.w: G = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.w: F = None
        self.y: G = None
        self.t: C = None
        self.r: B = None
        self.v: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: E = None
        self.s: C = None
        self.o: B = None
        self.p: I = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

g = A("g")
a = B("a")
f = C("f")
l = D("l")
d = E("d")
e = F("e")
c = G("c")
i = H("i")
j = I("j")
k = G("k")

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: G = None
        self.x: H = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: G = None
        self.o: F = None
        self.z: C = None
        self.r: H = None
        self.w: G = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.w: F = None
        self.y: G = None
        self.t: C = None
        self.r: B = None
        self.v: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: E = None
        self.s: C = None
        self.o: B = None
        self.p: I = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

g = A("g")
a = B("a")
f = C("f")
l = D("l")
d = E("d")
e = F("e")
c = G("c")
i = H("i")
j = I("j")
k = G("k")

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