class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: D = None
        self.q: C = None
        self.x: A = None
        self.u: A = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.p: B = None
        self.txt = txt

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

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

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

j = A("j")
l = B("l")
a = C("a")
d = D("d")
i = E("i")
g = F("g")
m = A("m")
b = D("b")

j.t = m
j.x = m
j.u = m
j.s = d
j.q = a
j.y = g
l.z = m
a.u = g
a.t = d
a.p = l
d.p = g
d.y = g
d.t = i
i.t = m
i.x = m
g.y = l
g.x = i
g.t = m
g.z = j
m.t = j
m.x = j
m.u = j
m.s = b
m.q = a
m.y = g
b.p = g
b.y = g
b.t = i
assert g.z.q.t.t.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: D = None
        self.q: C = None
        self.x: A = None
        self.u: A = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.p: B = None
        self.txt = txt

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

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

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

j = A("j")
l = B("l")
a = C("a")
d = D("d")
i = E("i")
g = F("g")
m = A("m")
b = D("b")

j.t = m
j.x = m
j.u = m
j.s = d
j.q = a
j.y = g
l.z = m
a.u = g
a.t = d
a.p = l
d.p = g
d.y = g
d.t = i
i.t = m
i.x = m
g.y = l
g.x = i
g.t = m
g.z = j
m.t = j
m.x = j
m.u = j
m.s = b
m.q = a
m.y = g
b.p = g
b.y = g
b.t = i
assert g.z.q.t.t.t.y.txt == "g"