class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: G = None
        self.x: D = None
        self.v: B = None
        self.r: H = None
        self.z: H = None
        self.s: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: H = None
        self.v: D = None
        self.w: D = None
        self.s: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: B = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: C = None
        self.o: D = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: H = None
        self.v: D = None
        self.w: D = None
        self.s: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: B = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: C = None
        self.o: D = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

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