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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: E = None
        self.r: D = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: B = None
        self.x: C = None
        self.v: A = None
        self.p: D = None
        self.txt = txt

i = A("i")
f = B("f")
g = C("g")
m = D("m")
h = E("h")
k = F("k")
c = G("c")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: E = None
        self.r: D = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: B = None
        self.x: C = None
        self.v: A = None
        self.p: D = None
        self.txt = txt

i = A("i")
f = B("f")
g = C("g")
m = D("m")
h = E("h")
k = F("k")
c = G("c")

i.x = k
i.s = k
i.z = k
i.y = g
i.u = m
i.p = f
f.v = c
f.w = h
f.q = g
g.w = k
g.o = i
g.y = c
m.y = h
m.q = h
m.u = h
m.r = c
m.p = i
m.w = g
m.x = f
h.w = f
k.p = i
k.v = h
k.r = m
k.s = f
c.t = k
c.u = f
c.x = g
c.v = i
c.p = m
assert m.u.w.w.w.w.w.v.txt == "c"