class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: B = None
        self.p: C = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: A = None
        self.o: B = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: A = None
        self.s: D = None
        self.txt = txt

h = A("h")
a = B("a")
c = C("c")
e = D("e")
m = E("m")
f = F("f")
b = G("b")
i = A("i")

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: A = None
        self.o: B = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: A = None
        self.s: D = None
        self.txt = txt

h = A("h")
a = B("a")
c = C("c")
e = D("e")
m = E("m")
f = F("f")
b = G("b")
i = A("i")

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