class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: B = None
        self.w: H = None
        self.p: C = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: B = None
        self.q: B = None
        self.z: C = None
        self.t: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: B = None
        self.q: B = None
        self.z: C = None
        self.t: H = None
        self.txt = txt

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

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

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