class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: C = None
        self.q: D = None
        self.z: G = None
        self.r: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: B = None
        self.y: F = None
        self.r: A = None
        self.p: B = None
        self.o: B = None
        self.s: E = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: C = None
        self.q: D = None
        self.z: G = None
        self.r: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: B = None
        self.y: F = None
        self.r: A = None
        self.p: B = None
        self.o: B = None
        self.s: E = None
        self.u: A = None
        self.txt = txt

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

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