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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.s: C = None
        self.q: A = None
        self.u: D = None
        self.p: C = None
        self.v: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: B = None
        self.w: D = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: D = None
        self.y: D = None
        self.t: B = None
        self.u: D = None
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.s: C = None
        self.q: A = None
        self.u: D = None
        self.p: C = None
        self.v: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: B = None
        self.w: D = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: D = None
        self.y: D = None
        self.t: B = None
        self.u: D = None
        self.v: B = None
        self.txt = txt

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

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