class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: E = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: A = None
        self.z: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: A = None
        self.t: F = None
        self.txt = txt

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

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

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

j.y = e
j.q = e
j.w = c
l.y = b
f.y = l
f.x = n
f.z = n
f.w = i
e.q = b
e.w = j
e.z = i
e.v = i
c.q = h
c.p = j
c.t = i
i.o = c
i.t = f
i.z = e
i.x = b
b.s = h
b.u = n
b.w = i
b.z = j
h.s = b
h.u = l
h.w = i
h.z = j
n.y = b
assert i.x.u.y.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: E = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: A = None
        self.z: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: A = None
        self.t: F = None
        self.txt = txt

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

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

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

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