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

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

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

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

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

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

i = A("i")
f = B("f")
k = C("k")
h = D("h")
g = E("g")
e = F("e")
b = F("b")

i.x = g
i.o = f
f.x = k
f.q = k
f.s = k
k.x = h
k.w = g
k.q = g
k.s = g
k.o = f
h.q = g
h.t = g
h.z = i
g.o = k
e.x = g
e.q = i
e.v = h
b.x = g
b.q = i
b.v = h
assert e.x.o.x.z.o.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

i = A("i")
f = B("f")
k = C("k")
h = D("h")
g = E("g")
e = F("e")
b = F("b")

i.x = g
i.o = f
f.x = k
f.q = k
f.s = k
k.x = h
k.w = g
k.q = g
k.s = g
k.o = f
h.q = g
h.t = g
h.z = i
g.o = k
e.x = g
e.q = i
e.v = h
b.x = g
b.q = i
b.v = h
assert e.x.o.x.z.o.s.s.txt == "g"