class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: E = None
        self.r: D = None
        self.y: H = None
        self.x: C = None
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: C = None
        self.w: E = None
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: B = None
        self.z: E = None
        self.u: F = None
        self.v: B = None
        self.r: B = None
        self.y: C = None
        self.t: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: C = None
        self.w: E = None
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: B = None
        self.z: E = None
        self.u: F = None
        self.v: B = None
        self.r: B = None
        self.y: C = None
        self.t: A = None
        self.txt = txt

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

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