class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: B = None
        self.z: C = None
        self.s: B = None
        self.p: B = None
        self.q: G = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: A = None
        self.o: E = None
        self.q: D = None
        self.txt = txt

j = A("j")
g = B("g")
l = C("l")
f = D("f")
b = E("b")
h = F("h")
i = G("i")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: A = None
        self.o: E = None
        self.q: D = None
        self.txt = txt

j = A("j")
g = B("g")
l = C("l")
f = D("f")
b = E("b")
h = F("h")
i = G("i")

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