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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: E = None
        self.txt = txt

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

i.s = k
i.x = a
m.o = f
m.q = a
m.t = h
a.o = m
a.z = m
a.q = h
a.y = h
a.t = d
f.x = h
f.q = m
f.w = i
j.r = b
j.p = b
j.y = i
j.z = k
j.o = d
j.x = a
d.u = m
d.x = b
k.s = i
k.x = a
b.r = j
b.p = j
b.y = k
b.z = k
b.o = d
b.x = h
h.o = m
h.z = m
h.q = a
h.y = a
h.t = d
assert k.s.s.s.x.t.x.o.txt == "d"