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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: D = None
        self.o: F = None
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: A = None
        self.q: F = None
        self.p: D = None
        self.x: F = None
        self.y: D = None
        self.txt = txt

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

j = A("j")
h = B("h")
e = C("e")
f = D("f")
a = E("a")
i = F("i")
m = C("m")

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: D = None
        self.o: F = None
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: A = None
        self.q: F = None
        self.p: D = None
        self.x: F = None
        self.y: D = None
        self.txt = txt

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

j = A("j")
h = B("h")
e = C("e")
f = D("f")
a = E("a")
i = F("i")
m = C("m")

j.x = m
h.u = f
h.s = f
h.o = i
h.q = m
e.q = i
e.y = f
f.w = e
f.v = e
a.w = i
a.q = i
a.x = i
a.z = j
a.p = f
a.y = f
i.q = j
i.u = h
i.v = f
m.q = i
m.y = f
assert i.q.x.q.txt == "i"