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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: E = None
        self.x: E = None
        self.z: C = None
        self.o: B = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: E = None
        self.x: E = None
        self.z: C = None
        self.o: B = None
        self.t: D = None
        self.txt = txt

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

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

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