class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: D = None
        self.t: G = None
        self.o: D = None
        self.s: E = None
        self.q: C = None
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: C = None
        self.txt = txt

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

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