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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: B = None
        self.p: E = None
        self.u: B = None
        self.s: A = None
        self.x: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: C = None
        self.z: E = None
        self.r: E = None
        self.y: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: B = None
        self.p: E = None
        self.u: B = None
        self.s: A = None
        self.x: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: C = None
        self.z: E = None
        self.r: E = None
        self.y: D = None
        self.txt = txt

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

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